/**
 * 路由配置
 */
import { createRouter, createWebHistory } from 'vue-router';
import Home from '@/views/Home.vue';
import Players from '@/views/Players.vue';
import PlayerProfile from '@/views/PlayerProfile.vue';
import Leaderboard from '@/views/Leaderboard.vue';
import Login from '@/views/Login.vue';

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'Home',
      component: Home
    },
    {
      path: '/players',
      name: 'Players',
      component: Players
    },
    {
      path: '/player/:id',
      name: 'PlayerProfile',
      component: PlayerProfile,
      props: true
    },
    {
      path: '/leaderboard',
      name: 'Leaderboard',
      component: Leaderboard
    },
    {
      path: '/login',
      name: 'Login',
      component: Login
    }
  ]
});

export default router;